Pneumonia remains one of the leading causes of respiratory illness worldwide and requires timely diagnosis to reduce disease severity and mortality. Interpretation of chest X-ray images is a routine diagnostic procedure; however, manual examination can be time-consuming and is influenced by the experience of radiologists. Computer-aided diagnostic systems based on artificial intelligence have therefore attracted considerable attention as supportive tools for clinical decision-making. This research presents a hybrid framework that combines deep feature extraction with traditional machine learning techniques for automated pneumonia detection from chest X-ray images. Initially, chest X-ray images are preprocessed and analysed using an EfficientNetV2 convolutional neural network to learn representative image features. Instead of directly performing end-to-end classification, the extracted deep features are used to train three supervised machine learning classifiers: Random Forest, Support Vector Machine (SVM), and Extreme Gradient Boosting (XGBoost). This hybrid strategy combines the feature representation capability of deep learning with the classification efficiency of conventional machine learning algorithms. To improve model transparency, Gradient-weighted Class Activation Mapping (Grad-CAM) is employed to highlight image regions that contribute most to the prediction. Furthermore, the selected classifier is integrated into a Streamlit-based web application that enables users to upload chest X-ray images and obtain real-time diagnostic predictions.
Experimental evaluation demonstrates that the Support Vector Machine classifier achieved the highest performance among the evaluated models, with an accuracy of 89.74%, precision of 86.22%, recall of 99.49%, F1-score of 92.38%, and ROC-AUC of 98.21%, indicating strong capability for distinguishing pneumonia from normal chest radiographs. The proposed framework illustrates that combining deep feature extraction with machine learning classifiers can provide accurate, interpretable, and computationally efficient pneumonia detection while supporting practical clinical deployment.
Introduction
Pneumonia is a serious respiratory infection that affects the lungs and can lead to severe health complications, especially among children, elderly individuals, and immunocompromised patients. Early and accurate diagnosis is essential for effective treatment. Chest X-rays are widely used for pneumonia detection due to their accessibility and low cost; however, manual interpretation requires expert knowledge and may be challenging because of variations in image quality and disease appearance.
Recent advances in Artificial Intelligence (AI), particularly Deep Learning (DL), have improved medical image analysis. Convolutional Neural Networks (CNNs) can automatically extract important image features, but they often require large datasets, high computational resources, and lack interpretability. To address these limitations, hybrid approaches combining deep feature extraction and traditional machine learning classifiers have gained attention.
This study proposes a hybrid pneumonia detection framework using EfficientNetV2 for deep feature extraction and three machine learning classifiers: Random Forest (RF), Support Vector Machine (SVM), and Extreme Gradient Boosting (XGBoost). Extracted image features are classified using these algorithms, and their performance is evaluated using accuracy, precision, recall, F1-score, and ROC-AUC metrics. The system also integrates Gradient-weighted Class Activation Mapping (Grad-CAM) to provide visual explanations by highlighting the chest regions influencing model decisions.
The major contributions of the research include:
Development of a hybrid AI framework for pneumonia detection from chest X-ray images.
Use of EfficientNetV2 for extracting meaningful deep image features.
Comparative evaluation of RF, SVM, and XGBoost classifiers.
Integration of Grad-CAM for improving model transparency.
Deployment of the best-performing model through a Streamlit-based web application for real-time diagnosis.
The literature review highlights the evolution from traditional machine learning methods using handcrafted features to modern CNN-based approaches. While CNN models achieve high accuracy, hybrid models offer improved efficiency, reduced complexity, and better interpretability. Explainable AI techniques such as Grad-CAM help clinicians understand model predictions by identifying important anatomical regions.
The proposed methodology consists of six main stages:
Image Acquisition: Collection of chest X-ray images categorized into Normal and Pneumonia classes.
Preprocessing: Images are resized, normalized, and organized for model training.
Feature Extraction: EfficientNetV2 extracts high-level deep features from X-ray images.
Classification: Extracted features are classified using RF, SVM, and XGBoost.
Explainability: Grad-CAM generates heatmaps showing regions responsible for predictions.
Deployment: The final model is integrated into a Streamlit application for practical use.
Experimental results show that the Support Vector Machine (SVM) classifier achieved the best performance, with:
Accuracy: 89.74%
Precision: 86.22%
Recall: 99.49%
F1-score: 92.38%
ROC-AUC: 98.21%
Conclusion
This research presented a hybrid deep learning and machine learning framework for automated pneumonia detection using chest X-ray images. The proposed methodology combined the feature extraction capability of EfficientNetV2 with the classification efficiency of conventional machine learning algorithms to develop an accurate and computationally efficient computer-aided diagnosis system. Unlike traditional end-to-end deep learning approaches, the proposed framework separated feature learning from classification, enabling a comparative evaluation of multiple classifiers while preserving the discriminative information extracted by the convolutional neural network. The experimental evaluation demonstrated that all investigated classifiers were capable of distinguishing between normal and pneumonia chest radiographs with high sensitivity. However, the Support Vector Machine (SVM) consistently achieved the best overall performance, obtaining an accuracy of 89.74%, precision of 86.22%, recall of 99.49%, F1-score of 92.38%, and ROC-AUC of 98.21%. These results indicate that the deep feature representations generated by EfficientNetV2 can be effectively utilized by conventional machine learning classifiers to achieve reliable diagnostic performance.
In addition to quantitative performance, the study emphasized model interpretability through the integration of Gradient-weighted Class Activation Mapping (Grad-CAM). The generated activation maps highlighted pulmonary regions that contributed most strongly to the prediction, providing visual evidence that supports the model\'s diagnostic decisions. Such explainability is particularly valuable in medical image analysis because it enables clinicians to better understand and verify automated predictions rather than relying solely on numerical outputs.
References
This research presented a hybrid deep learning and machine learning framework for automated pneumonia detection using chest X-ray images. The proposed methodology combined the feature extraction capability of EfficientNetV2 with the classification efficiency of conventional machine learning algorithms to develop an accurate and computationally efficient computer-aided diagnosis system. Unlike traditional end-to-end deep learning approaches, the proposed framework separated feature learning from classification, enabling a comparative evaluation of multiple classifiers while preserving the discriminative information extracted by the convolutional neural network. The experimental evaluation demonstrated that all investigated classifiers were capable of distinguishing between normal and pneumonia chest radiographs with high sensitivity. However, the Support Vector Machine (SVM) consistently achieved the best overall performance, obtaining an accuracy of 89.74%, precision of 86.22%, recall of 99.49%, F1-score of 92.38%, and ROC-AUC of 98.21%. These results indicate that the deep feature representations generated by EfficientNetV2 can be effectively utilized by conventional machine learning classifiers to achieve reliable diagnostic performance.
In addition to quantitative performance, the study emphasized model interpretability through the integration of Gradient-weighted Class Activation Mapping (Grad-CAM). The generated activation maps highlighted pulmonary regions that contributed most strongly to the prediction, providing visual evidence that supports the model\'s diagnostic decisions. Such explainability is particularly valuable in medical image analysis because it enables clinicians to better understand and verify automated predictions rather than relying solely on numerical outputs.